package com.atos.optical.controller;

import com.atos.optical.common.ApiResult;
import com.atos.optical.common.BaseHttpController;
import com.atos.optical.model.po.SysProductInfoVersion;
import com.atos.optical.model.query.SysProductInfoVersionQuery;
import com.atos.optical.service.SysProductInfoVersionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author wanghra
 * @version 1.0
 * @description
 * @date 2025/8/15
 */
@RestController
@RequestMapping("/product/version/info")
public class SysProductInfoVersionController extends BaseHttpController {
    @Autowired
    private SysProductInfoVersionService service;

    @GetMapping("/getById/{id}")
    public ApiResult<SysProductInfoVersion> getById(@PathVariable("id") String id) {
        return new ApiResult<>(service.getById(id));
    }

    @GetMapping("/page")
    public ApiResult<SysProductInfoVersionQuery> pageByQuery(SysProductInfoVersionQuery query) {
        return new ApiResult<>(service.pageByQuery(query));
    }
}
